~ chicken-core (chicken-5) /manual/Module (chicken errno)
Trap1[[tags: manual]]
2[[toc:]]
3
4== Module (chicken errno)
5
6This module provides access to the standard C {{errno}} value.
7
8Be careful, if you're using threads, {{errno}} might be clobbered as
9soon as another thread calls a C function. To prevent this from
10happening, you can add {{(declare (disable-interrupts))}} at the top
11of your file, or use the {{-disable-interrupts}} compiler option to
12avoid any context switches while a procedure in this file is running.
13
14=== errno
15
16<procedure>(errno)</procedure>
17
18Returns the error code of the last system call.
19
20=== errno constants
21
22<constant>errno/perm</constant><br>
23<constant>errno/noent</constant><br>
24<constant>errno/srch</constant><br>
25<constant>errno/intr</constant><br>
26<constant>errno/io</constant><br>
27<constant>errno/noexec</constant><br>
28<constant>errno/badf</constant><br>
29<constant>errno/child</constant><br>
30<constant>errno/nomem</constant><br>
31<constant>errno/acces</constant><br>
32<constant>errno/fault</constant><br>
33<constant>errno/busy</constant><br>
34<constant>errno/notdir</constant><br>
35<constant>errno/isdir</constant><br>
36<constant>errno/inval</constant><br>
37<constant>errno/mfile</constant><br>
38<constant>errno/nospc</constant><br>
39<constant>errno/spipe</constant><br>
40<constant>errno/pipe</constant><br>
41<constant>errno/again</constant><br>
42<constant>errno/rofs</constant><br>
43<constant>errno/exist</constant><br>
44<constant>errno/wouldblock</constant>
45
46These variables contain error codes as returned by {{errno}}.
47
48''NOTE'': On Windows, {{EWOULDBLOCK}} does not exist. For
49consistency, {{errno/wouldblock}} does exist, but it is defined as
50zero.
51
52This does mean that in case there is no error, it looks like the
53{{errno/wouldblock}} error is returned. But you have to check the
54return code of a system call before accessing {{errno}} anyway, so
55this should typically never happen.
56
57---
58Previous: [[Module (chicken csi)]]
59
60Next: [[Module (chicken eval)]]